Ubuntu 16.04 for network

ubuntu16.04修改网卡名称为eth0

修改Grub配置文件

1
sudo nano /etc/default/grub

找到GRUB_CMDLINE_LINUX=””
改为GRUB_CMDLINE_LINUX=”net.ifnames=0 biosdevname=0”
然后:

1
sudo grub-mkconfig -o /boot/grub/grub.cfg

打开ubuntu的/etc/network/interfaces文件默认的内容如下:

1
2
3
4
5
6
7
8
9
10
11
auto lo 
iface lo inet loopback
//获取动态配置:
auto eth0
iface eth0 inet dhcp
//获取静态配置:
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.1

重启

1
sudo reboot